//
//  helpFunc.swift
//  touc
//
//  Created by z on 2020/6/26.
//  Copyright © 2020 z. All rights reserved.
//

import Foundation
typealias uint8 = uint_fast8_t
typealias bytes=[uint8]
typealias long = Int64
typealias uint32 = uint_fast32_t
typealias uint16 = uint_fast16_t
var temp = ""
var POLLIN =         1
var POLLOUT =        4
var POLLERR =        8
var tcpReadLen = 65536
var udpReadLen = 2000
var con_getNum = 10
var con_timeoutInternal:long = 20
var con_maxConn = 500
var con_cachePerConn = 200*1024
var server_port = 8895
var con_serverKey = bytes()
var con_packEffectTime:long = 10
var serverStaPerSecond = 40
var con_ssPort = 8080
var htimeoutTime:long = 1000
var con_localPort = 9997
var con_timeoutPlus:long = 80

var serverSenLen = 1440
var cliSenLen = 1440
var cliPackLen = 0
var serverPackLen = 0

var con_key = bytes()


var maxNewSockPerSecond = 50
var con_portsNum = 100
var con_connBufSize = 300*1024

//var serverIp="127.0.0.1"
//var serverIp="42.51.28.250"
var serverIp="149.129.66.208"
var con_maxPackRecv = 400
func iniHelp()
    {
        con_key = bytes("tr".utf8)
        con_serverKey = bytes("hfeiffcc".utf8)
        cliPackLen =   cliSenLen-35-con_key.count-getDamMaxLen() - 4*con_getNum
      serverPackLen  = ((serverSenLen-20-getDamMaxLen())/con_getNum)-2
}
func getDamMaxLen()->Int
{
    return 0
}

func getTime()->long {
    return long(Date().timeIntervalSince1970*1000)
}



